﻿
@{
    ViewBag.Title = "CheckFenZhi";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/Template/ace_admin_v1.4.0/components/spin.js/spin.js"></script>
<div class="row" id="app">
    <div class="col-xs-12">
        <!--人员列表-->
        <div class="row" id="list">
            <div class="col-xs-12">
                <div class="table-header">
                    教职工列表
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        <p>
                            <button class="btn btn-white btn-info btn-bold" v-on:click="p_AddData()">
                                <i class="ace-icon glyphicon glyphicon-plus bigger-120 blue"></i>
                                新增人员
                            </button>
                        </p>
                    </div>
                </div>
                <div>
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                            <tr>
                                <th class="center">
                                    账号/编号
                                </th>
                                <th>姓名</th>
                                <th>性别</th>
                                <th>手机号</th>
                                <th>所在科室</th>
                                <th>职务</th>
                                <th></th>
                            </tr>
                        </thead>

                        <tbody>
                            <tr v-for="tr in users">
                                <td class="center">
                                    {{tr.username}}
                                </td>
                                <td>{{tr.XingMing}}</td>
                                <td>
                                    <template v-if="tr.XingBie==0">
                                        未知
                                    </template>
                                    <template v-if="tr.XingBie==1">
                                        男
                                    </template>
                                    <template v-if="tr.XingBie==2">
                                        女
                                    </template>
                                </td>
                                <td>{{tr.ShouJiHao}}</td>
                                <td>{{tr.keshi.ksmc}}</td>
                                <td>{{tr.zwmc}}</td>
                                <td>
                                    <div class="btn-group">
                                        <button data-toggle="dropdown" class="btn btn-primary btn-white dropdown-toggle btn-sm " aria-expanded="true">
                                            操作
                                            <i class="ace-icon fa fa-angle-down icon-on-right"></i>
                                        </button>

                                        <ul class="dropdown-menu">
                                            <li>
                                                <a href="javascript:void(0)" v-on:click="p_RejectGZJH(tr.username)">退回</a>
                                            </li>
                                        </ul>
                                    </div>
                                </td>
                            </tr>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="~/Scripts/JsModel/Model_JiaoZhiGong.js"></script>
<script type="text/javascript">
    var vm = new Vue({
        el: '#app',
        data: {
            user: new JiaoZhiGong(),
            users: [],
            sousuo: { keyword: "", ksid: 0, zwid: 0, pageIndex: 1, pageSize:200}
        },
        methods: {         
            p_GetDatas: function () {
                debugger;
                var _self = this;
                var para = { params: {
                    keyword: _self.sousuo.keyword,
                    ksid: _self.sousuo.ksid,
                    zwid: _self.sousuo.zwid,
                    pageIndex: _self.sousuo.pageIndex,
                    pageSize: _self.sousuo.pageSize
                } }
                axios.get('@Url.Action("Gets", "Admin")' ).then(
                    function (response) {
                        _self.users = [];
                        for (var i = 0; i < response.data.data.length; i++) {
                            _self.users.push(response.data.data[i]);
                        }
                        },
                        function(response) {
                            alert(response.status);
                        }
                    )
                    .catch(
                        function(error) {
                            alert(error);
                        }
                    );
            },
            p_RejectGZJH: function (username) {
                ///<summary>退回工作计划</summary>
                var _self = this;
                var para = { params: {
                    username: username
                } }
                axios.get('@Url.Action("GongZuoJiHuaReject", "Admin")', para ).then(
                        function (response) {
                            bootbox.alert("成功", function() {
                                _self.p_GetDatas();
                            });
                        },
                        function(response) {
                            alert(response.status);
                        }
                    )
                    .catch(
                        function(error) {
                            alert(error);
                        }
                    );
            },
            Init: function() {

            }
        },
        created() {
            //console.log("页面初始化完成111");
        },
        mounted() {
            this.p_GetDatas();
        }
    });
</script>